/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace DaveSexton.DocProject.Sandcastle.TopicManagement
{
	[System.ComponentModel.TypeConverter(typeof(TopicTypeCollectionConverter))]
	public sealed class TopicTypeCollection : Collection<TopicType>
	{
		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="TopicTypeCollection" /> class.
		/// </summary>
		public TopicTypeCollection()
		{
		}

		/// <summary>
		/// Constructs a new instance of the <see cref="TopicTypeCollection" /> class.
		/// </summary>
		public TopicTypeCollection(IEnumerable<TopicType> items)
			: base(new List<TopicType>(items))
		{
		}
		#endregion
	}

	public sealed class TopicTypeCollectionConverter : CollectionConverter<TopicType>
	{
		#region Public Properties
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
		public static readonly TopicTypeCollectionConverter Default = new TopicTypeCollectionConverter();
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="TopicTypeCollectionConverter" /> class.
		/// </summary>
		public TopicTypeCollectionConverter()
			: base(',', ' ')
		{
		}
		#endregion

		#region Methods
		public override ICollection<TopicType> CreateCollection()
		{
			return new TopicTypeCollection();
		}
		#endregion
	}
}
